<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>商品详情</title>
		<script>
				window.admin  ='__ADMIN__'
		</script>
		<link rel="stylesheet" href="__ADMIN__/static/index/css/common.css" />
		<link rel="stylesheet" href="__ADMIN__/static/index/css/pro_details.css" />
		<script type="text/javascript" src="__ADMIN__/static/index/js/jquery.min.js"></script>
		<script type="text/javascript" src="__ADMIN__/static/index/js/common.js"></script>
	</head>

	<body>
		<!--头部-->
			{include file='public/_header' /}
			<!--搜索栏-->
			{include file='public/_search' /}
			</div>
		<!--内容-->
		<div class="middle">
			<div class="box">
				<div class="img_info">
					<div class="big">
						<img src="__ADMIN__{:$goodsimg[0]}" alt="" />
						<div class="box1"></div>
					</div>
					
					<div class="thumb">
						<div>
							<ul>
							{volist name='goodsimg' id='vo'}
								<li><img src="__ADMIN__{:$vo}" alt="" /></li>
							{/volist}
							</ul>
						</div>
						<span class="left"><img src="__ADMIN__/static/index/img/arrow_left.png" alt="" /></span>
						<span class="right"><img src="__ADMIN__/static/index/img/arrow_right.png" alt="" /></span>
					</div>
				</div>
				<div class="pro_info">
					<span style="display: none;" id="buy_id" buy_id='{:$good.id}'></span>
					{volist name='goodstyle' id='vo' key="k"}
						{if($k==1)}
							<div class="original"></div>
							<h5>{:$good['goods_summary']}</h5>
							<span>收藏</span>
							<div>
								<p id="selected_price">{:$vo.goods_price}</p>
								<span>特色：{:$vo.special}</span>
								<span>优惠：{:$vo.discount}</span>
								<ul>
									<li>月销量 647</li>
									<li>评价 647</li>
								</ul>
							</div>
							<dl class="choose">
								<dt>颜色分类</dt>
									<dd class="shop_goods_detail_id active" shop_goods_detail={:$vo.id}><img style="display: block;height: 64px;width: 62px;" src="__ADMIN__{:$vo.color_img}" /></dd>
						{else}
									<dd class="shop_goods_detail_id" shop_goods_detail={:$vo.id}><img style="display: block;height: 64px;width: 62px;" src="__ADMIN__{:$vo.color_img}" /></dd>
						{/if}
					{/volist}	
							</dl>
							<script>
								//选择产品颜色显示对应价格
								var dd = document.getElementsByClassName("choose")[0].getElementsByTagName("dd");
								$('.shop_goods_detail_id').click(function(){
									for(var i = 0; i < dd.length; i++){
								        dd[i].onclick = function() {
								          for(var i = 0; i < dd.length; i++){
								              dd[i].className = "";
								          }
								            this.className = "active";
								        }
								    }
									var shop_goods_detail = $(this).attr('shop_goods_detail')
									$.get('{:url("index/Product/getprice")}',{id:shop_goods_detail},function(date){
										$('#selected_price').text(date);
									})
									$.get('{:url("index/Product/getnum")}',{id:shop_goods_detail},function(date){
										$('#selected_num').text(date);
									})
								})	
							</script>
					<dl class="quantity">
						<dt>数量</dt>
						<dd>
							<input id="buy_num" type="text" name="quantity_name" class="quantity_num" value="1">
							<div class="add"><span></span></div>
							<div class="reduce"><span></span></div>
							
						</dd>
						
						{volist name='goodstyle' id='vo' key="k"}
							{if($k==1)}
								<dd>库存<span id="selected_num">{:$vo.goods_num}</span>件</dd>
							{/if}
						{/volist}	
					</dl>
					<a id="add_pay" href="javascript:void(0)" class="purchase">立即购买</a>
					<script>
						$('#add_pay').click(function(){
							var buy_num = $('#buy_num').val();
							var buy_id = $('#buy_id').attr('buy_id');
							var buy_style = $('.active').attr('shop_goods_detail');
							$.post('{:url("index/pay/directpay")}',
								{buy_id:buy_id,buy_num:buy_num,buy_style:buy_style},
								function(data){
//									console.log(data);return false;
									if(data == 40000)
									{
										window.location = '{:url("index/pay/confirm_order")}';
									}else
									{
										alert('当前用户未登录');
										window.location = '{:url("index/login/index")}';
									}
								}
							)
							return false;
						})
					</script>
					<a href="javascript:void(0)" class="add_to_cart" id="addcar">加入购物车</a>
					<script>
						$('#addcar').click(function(){
							var buy_num = $('#buy_num').val();
							var buy_id = $('#buy_id').attr('buy_id');
							var buy_style = $('.active').attr('shop_goods_detail');
							$.post('{:url("index/car/addcar")}',
								{buy_id:buy_id,buy_num:buy_num,buy_style:buy_style},
								function(data){
									data = JSON.parse(data)
//									console.log(data);return false;
									if(data[0] == 40000)
									{
										alert(111);return false;
									}
								}
							)
							return false;
						})
					</script>
				</div>
				<div class="parameters">
					<h4>产品参数</h4>
					<ul>
						<li>产品名称：豪华智能电饭煲 </li>
						<li>C产品型号：FXB30FZ16Q-60 3.0L 600</li>
						<li>电饭煲多功能: 加速煮 蛋糕 预约 定时 煮饭</li>
						<li>容量：4L</li>
						<li>内胆材质：陶金</li>
						<li>颜色：黑白灰</li>
						<li>适用人数：4-6人</li>
						<li> 控制方式：微电脑式</li>
						<li>加热方式：三维立体加热</li>
					</ul>
				</div>
				<div class="tabs">
					<span class="pro_detail on">产品详情</span>
					<span class="comment">商品评价</span>
				</div>
				<ul class="details">
					<li>
						<img src="__ADMIN__/static/index/img/pro_details_01.jpg"><span></span>
						<div>
							分体式构成，<br />妈妈说提锅方便清洗。
							<p>轻便提锅，清洁轻松</p>
						</div>
					</li>
					<li>
						<img src="__ADMIN__/static/index/img/pro_details_02.jpg"><span></span>
						<div>
							分体式构成，<br />妈妈说提锅方便清洗。
							<p>轻便提锅，清洁轻松</p>
						</div>
					</li>
					<li>
						<img src="__ADMIN__/static/index/img/pro_details_03.jpg"><span></span>
						<div>
							分体式构成，<br />妈妈说提锅方便清洗。
							<p>轻便提锅，清洁轻松</p>
						</div>
					</li>
					<li>
						<img src="__ADMIN__/static/index/img/pro_details_04.jpg"><span></span>
						<div>
							分体式构成，<br />妈妈说提锅方便清洗。
							<p>轻便提锅，清洁轻松</p>
						</div>
					</li>
				</ul>
				<div class="evalution">
					<ul class="score">
						<li>
							<img src="__ADMIN__/static/index/img/evalution_quantity.png" />
							<span>质量好</span>
						</li>
						<li>
							<img src="__ADMIN__/static/index/img/evalution_practicability.png" />
							<span>很实用</span>
						</li>
						<li>
							<img src="__ADMIN__/static/index/img/evalution_transfer.png" />
							<span>物流快</span>
						</li>
						<li>
							<img src="__ADMIN__/static/index/img/evalution_server.png" />
							<span>服务一流</span>
						</li>
						<li>
							<img src="__ADMIN__/static/index/img/evalution_performance.png" />
							<span>性价比高</span>
						</li>
						<li>
							<img src="__ADMIN__/static/index/img/evalution_easy.png" />
							<span>简单易用</span>
						</li>
						<li>
							<img src="__ADMIN__/static/index/img/evalution_appearance.png" />
							<span>外观不错</span>
						</li>
					</ul>
					<ul class="evalute">
						<li>
							<div class="account">
								<span class="avatar"><img src="__ADMIN__/static/index/img/evaluation_account_img.jpg" /></span>
								<span class="account_name">账号</span>
							</div>
							<div>
								<p>以前推荐过朋友买两到四人的锅，家里用的也是那个型号。这次自己搬出来住，果断入手一个小号的，好可爱的锅，两个人吃足够了。以后每天给自己做早饭！ 包装很好，很满意。</p>
								<span class="time">2017-4-22</span>
								<a href="javascript:void(0)" class="addition">追加评论</a>
								<img src="__ADMIN__/static/index/img/evalute_img01.jpg" />
								<img src="__ADMIN__/static/index/img/evalute_img02.jpg" />
								<img src="__ADMIN__/static/index/img/evalute_img03.jpg" />
							</div>
						</li>
						<li>
							<div class="account">
								<span class="avatar"><img src="__ADMIN__/static/index/img/evaluation_account_img.jpg" /></span>
								<span class="account_name">账号</span>
							</div>
							<div>
								<p>以前推荐过朋友买两到四人的锅，家里用的也是那个型号。这次自己搬出来住，果断入手一个小号的，好可爱的锅，两个人吃足够了。以后每天给自己做早饭！ 包装很好，很满意。</p>
								<span class="time">2017-4-22</span>
							</div>
						</li>
						<li>
							<div class="account">
								<span class="avatar"><img src="__ADMIN__/static/index/img/evaluation_account_img.jpg" /></span>
								<span class="account_name">账号</span>
							</div>
							<div>
								<p>以前推荐过朋友买两到四人的锅，家里用的也是那个型号。这次自己搬出来住，果断入手一个小号的，好可爱的锅，两个人吃足够了。以后每天给自己做早饭！ 包装很好，很满意。</p>
								<span class="time">2017-4-22</span>
								<a href="javascript:void(0)" class="addition">追加评论</a>
								<img src="__ADMIN__/static/index/img/evalute_img01.jpg" />
								<img src="__ADMIN__/static/index/img/evalute_img02.jpg" />
								<img src="__ADMIN__/static/index/img/evalute_img03.jpg" />
							</div>
						</li>
					</ul>
					<div class="page_list">
						<ol class="page">
							<li><a href="javascript:void(0)">上一页</a></li>
							<li class="current"><a href="javascript:void(0)">1</a></li>
							<li><a href="javascript:void(0)">2</a></li>
							<li><a href="javascript:void(0)">3</a></li>
							<li><a href="javascript:void(0)">4</a></li>
							<li><a href="javascript:void(0)">...</a></li>
							<li><a href="javascript:void(0)">下一页</a></li>
						</ol>
					</div>
				</div>
				<div class="others">
					<h4>其他商品</h4>
					<ol>
						{volist name='othergood' id='vo'}
							<li>
								<input style="display: none;" id="other_id" value="{:$vo.id}" />
								<a href="{:url('index/product/index',['id'=>$vo.id])}"><img style="display: block;height: 309px;width: 293px;" src="__ADMIN__{:$vo.goods_thumb}" alt="" /></a>
								<h6><a href="{:url('index/product/index',['id'=>$vo.id])}">{:$vo.goods_name}</a></h6>
								<span class="price"><i>{:$vo.goods_price}</i></span>
								<span class="purchase"><a href="{:url('index/product/index',['id'=>$vo.id])}">点击购买</a></span>
								<p>
									<span class="quantity">销售量 199</span>
									<span class="stock">库存 {:$vo.goods_num}件</span>
								</p>
							</li>
						{/volist}
						
						
					</ol>
					
				</div>
			</div>
		</div>
		<!--尾部-->
		{include file='public/_foot' /}
		<script type="text/javascript" src="__ADMIN__/static/index/js/shopCar.js" ></script>
		<script type="text/javascript" src="__ADMIN__/static/index/js/pro_details.js" ></script>
		<script type="text/javascript" src="__ADMIN__/static/index/js/page.js" ></script>
	</body>
	
</html>
